<%@page import="com.wh.minihelp.user.domain.ChildInfo"%>
<%@page import="com.wh.minihelp.user.util.UserUtil"%>
<%@page import="com.wh.minihelp.user.domain.FamilyAccount"%>
<%@page import="com.wh.minihelp.flower.domain.FamilyFlower"%>
<%@page import="java.util.List"%>
<%@ page language="java" pageEncoding="UTF-8"%>
<%
	/*修改密码*/
%>
<div id="div_changePwd" class="weui-cells weui-cells-ex">
	<div class="weui-cells-oper">
		<a id="btnChangepwd" href="#" class="weui-btn weui-btn_mini weui-btn_primary">修改我的密码</a>
	</div>
</div>
<div style='display: none' id="div_ChangePwd_none">
	<div class="weui-cells weui-cells_form" id="div_ChangePwd">
		<div class="weui-cell">
			<div class="weui-cell__hd">
				<label style="color:red;">密码按连续图形点点方式进行输入。如第一行的横线就是数字密码123。</label>
			</div>
		</div>
		<div class="weui-cell">
			<div class="weui-cell__hd">
				<label class="weui-label">原密码:</label>
			</div>
			<div class="weui-cell__bd">
				<input class="weui-input" type="password" id="pwd" placeholder="请输入原密码~">
			</div>
		</div>
		<div class="weui-cell">
			<div class="weui-cell__hd">
				<label class="weui-label">新密码:</label>
			</div>
			<div class="weui-cell__bd">
				<input class="weui-input" type="password" id="pwd1" placeholder="请输入新密码~">
			</div>
		</div>
		<div class="weui-cell">
			<div class="weui-cell__hd">
				<label class="weui-label">密码确认:</label>
			</div>
			<div class="weui-cell__bd">
				<input class="weui-input" type="password" id="pwd2" placeholder="请重新输入一次密码~">
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
$(function(){
    $("#btnChangepwd").on('click', function(){
		$("#js_dialog_title").text("修改密码"); 
		$("#js_dialog_content").append($("#div_ChangePwd"));
		okFunction=function(){
			if ($.trim($("#pwd").val()).length == 0) {
				error("#pwd","为保证安全性，请先输入原密码！")
				return
			}
			if ($.trim($("#pwd1").val()).length == 0) {
				error("#pwd1","为保证安全性，请输入独立密码！")
				return
			}
			if ($.trim($("#pwd1").val())!=$.trim($("#pwd2").val())) {
				error("#pwd1","两次输入的密码不一致，请重新输入！")
				return
			}
			var ftype=$('#div_addFamily .weui-bar__item_on').attr('id');
			$.post("<%=path%>/u?m=pwd"
			  , { pwd: $.trim($("#pwd").val()) ,pwd1: $.trim($("#pwd1").val()),pwd2: $.trim($("#pwd2").val())}	   
			  ,function(data){
					if(data.success){
						$("#div_ChangePwd_none").append($("#div_ChangePwd"));
						$androidDialog1.css('display','none')
					}else{
						alert(data.msg)
					}
			   }, "json");	
		};
		cancelFunction=function(){
			$("#div_ChangePwd_none").append($("#div_ChangePwd"));
			$androidDialog1.css('display','none')
		};
		$androidDialog1.css('display','')
	});
});
</script>